import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '@/pages/Index'
import Login from '@/pages/Login'
import AddGoods from '@/pages/AddGoods'
import GoodsList from '@/pages/GoodsList'
import CartList from '@/pages/CartList'

Vue.use(VueRouter)
export default new VueRouter({
  routes: [
    {
      path: '/',
      component: Index,
      children: [
        {
          path: '/',
          component: AddGoods,
        },
        {
          path: '/goodsList',
          component: GoodsList,
        },
        {
          path: '/cartList',
          component: CartList,
        },
      ],
    },
    {
      path: '/login',
      component: Login,
    },
  ],
  mode: 'history',
  // 高亮的样式
  linkActiveClass: 'active',
})
